package com.lujianfei.powersearch.base

import android.os.Bundle
import android.view.*
import androidx.fragment.app.DialogFragment
import com.lujianfei.powersearch.R

abstract class BaseDialogFragment: DialogFragment() {

    abstract fun resourceId():Int

    abstract fun initView()

    abstract fun initEvent()

    abstract fun initData()

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        // 去掉默认的标题
        dialog?.requestWindowFeature(Window.FEATURE_NO_TITLE);
        return inflater.inflate(resourceId(), null)
    }

    override fun onActivityCreated(savedInstanceState: Bundle?) {
        super.onActivityCreated(savedInstanceState)
        initView()
        initEvent()
        initData()
    }
}